package com.snj.bestdealer.lib;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;

public class CustomBitmap {
	public static Bitmap scaleDownBitmap(Bitmap photo, int newHeight) {

		final float densityMultiplier = Resources.getSystem().getDisplayMetrics().density;

		int h = (int) (newHeight * densityMultiplier);
		int w = (int) (h * photo.getWidth() / ((double) photo.getHeight()));

		photo = Bitmap.createScaledBitmap(photo, w, h, true);

		return photo;
	}
}
